//
//  SLWeakScriptMessageHandler.m
//  ShopLeader
//
//  Created by 帅科 on 2020/7/13.
//  Copyright © 2020 ShopLeader. All rights reserved.
//

#import "SLWeakScriptMessageHandler.h"
#import <WebKit/WebKit.h>

@interface SLWeakScriptMessageHandler ()
@property (nonatomic,weak) id<WKScriptMessageHandler> scriptDelegate;
@end

@implementation SLWeakScriptMessageHandler

- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate
{
    if (self = [super init]) {
        self.scriptDelegate = scriptDelegate;
    }
    return self;
}

#pragma mark - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
{
    [self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message];
}


- (void)dealloc
{
    NSLog(@"%s",__func__);
}

@end
